import { reqGetsearchList } from '@/api/index';

let state = {
    searchList:{}
};

let mutations = {
    GETSEARCHLIST(state,searchList){
        state.searchList = searchList;
    }
};

let actions = {
    async getSearchList({ commit }, param = {}) {
        let result = await reqGetsearchList(param);
        if (result.code == 200) {
            commit('GETSEARCHLIST',result.data);
        }
    }
};

let getters = {
    goodsList(state){
        return state.searchList.goodsList;
    },
    attrsList(state){
        return state.searchList.attrsList;
    },
    trademarkList(state){
        return state.searchList.trademarkList;
    }
};

export default {
    state,
    mutations,
    actions,
    getters
}